<?php
/**
 * JoiGallery - image gallery component for Joostina
 *
 * Шаблон вывода страницы загрузки изображения
 *
 * @version 1.0 alpha 12
 * @package JoiGallery
 * @subpackage	View
 * @filename default.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2009 Joostina Team
 * @license see license.txt
 *
 **/
defined('_VALID_MOS') or die();

//Подключаем CSS-файл шаблона
//$mainframe->addCSS(JPATH_SITE.'/components/com_joigallery/view/css/default.css');
?>

<?php if(!$params->_access->allow_me('add_photo_single', $my->gid) && !$params->_access->allow_me('add_photo_archive', $my->gid) ){?>
  <div class="error"><?php echo $params->_access->error('add_photo_single'); ?></div>
<?php return ; } ?>

<div class="joi_gallery">
  <div class="joi_gallery_uploadphoto">

    <?php
    if ($params->add_image_pathway)
         echo '<div class="joi_gallery_pathway">'.mosPathWay().'</div>';
    ?>

    <div class="componentheading">
      <div class="buttons fr">
        <span class="button">
          <a class="button upload_item" href="javascript:void(0)" >
           <?php echo _C_JOIGALLERY_BUTTON_UPLOAD ?>
          </a>
        </span>
        <span class="button">
          <a class="button cancel cancel_item" href="javascript:void(0);" >
           <?php echo _CANCEL?>
          </a>
        </span>       
      </div>
      <?php if ($params->get('add_image_pagetitle')) { ?>
                <h1><?php echo $params->get('add_image_pagetitle'); ?></h1>
      <?php }
            else echo '<div class="clrpx">&nbsp;</div>';
      ?>
    </div>
    <div class="clrpx">&nbsp;</div>
    
    
    <form action="<?php echo sefRelToAbs('index.php')?>" method="post" name="adminForm" id="addPhoto" class="item_form" enctype="multipart/form-data">

      <div class="info">
        <?php echo _C_JOIGALLERY_UPLOAD_LIMIT; ?>: <?php echo ini_get('upload_max_filesize'); ?>
      </div>

      <table class="adminlist" width="100%" cellpadding="0" cellspacing="0">
        <?php if($params->get('add_image_fname', 1)): ?>
        <tr>
          <td><?php echo _C_JOIGALLERY_NAME; ?>: <?php echo mosToolTip(_C_JOIGALLERY_NAME_EMPTY, _C_JOIGALLERY_UPLOAD_HELP); ?></td>
          <td><input type="text" name="name" class="inputbox" size="30" value="" /></td>
        </tr>
        <tr>
         <td colspan="2">&nbsp;</td>
        </tr>
        <?php endif; ?>
        <tr>
          <td width="150"><?php echo _C_JOIGALLERY_UPLOAD_CATEGORY; ?>: </td>
          <td><?php echo mosHTML::selectList($categories, 'cid', 'class="inputbox text_area"', 'id', 'name'); ?></td>
        </tr>
        <tr>
         <td colspan="2">&nbsp;</td>
        </tr>

        <?php if( ( $params->_access->allow_me('set_state', $my->gid)
                 || $params->_access->allow_me('set_state_own', $my->gid) )
                 && $params->get('add_image_pubunpub', 1) ): ?>
        <tr>
          <td><?php echo _C_JOIGALLERY_PUBLISHED; ?>: </td>
          <td><?php echo mosHTML::yesnoRadioList('state', '', 1); ?></td>
        </tr>
        <?php endif; ?>

        <?php if( ( $params->_access->allow_me('main_photo', $my->gid) 
                 || $params->_access->allow_me('main_photo_own', $my->gid) )
                 && $params->get('add_image_default', 1) ): ?>
        <tr>
          <td><?php echo _C_JOIGALLERY_PHOTO_GALLERY_THUMBNAIL; ?>: </td>
          <td><?php echo mosHTML::yesnoRadioList('default', '', 0); ?></td>
        </tr>
        <?php endif; ?>
        <?php if($params->get('add_image_fdesc', 1)): ?>
        <tr>
         <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
          <td><?php echo _C_JOIGALLERY_DESCRIPTION; ?>:</td>
          <td>
            <?php if($params->get('add_image_fdesc_wwyg', 1)): ?>
            <?php editorArea( 'editor1', '' , 'description', '100%;', '300', '60', '20', $wwig_params ) ; ?>
            <?php else: ?><?php //echo $photo->description ?>
            <textarea rows="10" cols="100" class="inputbox text_area" name="description">&nbsp;</textarea>
            <?php endif; ?>
          </td>
        </tr>
        <tr>
         <td colspan="2">&nbsp;</td>
        </tr>
        <?php endif; ?>
        <?php if($params->_access->allow_me('add_photo_single', $my->gid)) :?>
        <tr>
          <td>&nbsp;</td>
          <td class="small gray"><?php echo _C_JOIGALLERY_UPLOAD_ONE; ?></td>
        </tr>        
        <tr>
         <td><?php echo _C_JOIGALLERY_UPLOAD_FILE; ?>: </td>
         <td><input type="file" name="photo" id="photo" class="inputbox" size="30" value="" /></td>
        </tr>
        <?php endif;?>
        <?php if($params->_access->allow_me('add_photo_archive', $my->gid)) :?>
        <tr>
         <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td class="small gray"><?php echo _C_JOIGALLERY_UPLOAD_TWO; ?></td>
        </tr>        
        <tr>
         <td><?php echo _C_JOIGALLERY_UPLOAD_ARCHIVE; ?>: </td>
         <td><input type="file" name="zip" id="zip" class="inputbox" size="30" value="" /></td>
        </tr>
        <?php endif;?>
        <tr>
         <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
         <td>&nbsp;</td>
         <td>
          <div class="buttons">
            <span class="button">
              <a class="button upload_item" href="javascript:void(0)" >
               <?php echo _C_JOIGALLERY_BUTTON_UPLOAD?>
              </a>
            </span>
            <span class="button">
              <a class="button cancel cancel_item" href="javascript:void(0);" >
               <?php echo _CANCEL?>
              </a>
            </span>
          </div>
         </td>
        </tr>
      </table>  

      <?php if($params->get('extrafields_add_photo', 0)){
                $extra_fields->load_fields('1');
                $extra_fields->print_all_fields('addPhoto', $params->get('extrafields_auto_js', 1));
      }?>

      <input type="hidden" name="Itemid" value="<?php echo $params->_Itemid; ?>" />
      <input type="hidden" name="option" value="<?php echo $params->_option; ?>" />
      <input type="hidden" name="task" id="task" value="" />
      <input type="hidden" name="act" value="photos" />
    </form>

  </div>
</div>